#include <core/init.h>
#include <autoconf.h>
#include <core/irq.h>
#include <core/io.h>



static int S3cRtcIsr(void *pDev)
{
	GuIncTick();

	//printf("%s(), gTickCount = %d\n", __FUNCTION__, GuGetTick());
	return 0;
}


static __INIT__ int S3cRtcInit(void)
{
	int ret;


	DRIVER_INFO("%s().\n", __FUNCTION__);

	ret = RegisterIsr(8, S3cRtcIsr, NULL);

	writeb(1, VA(RTC_BASE + RTCCON)); 
	writeb((1 << 7) | (0x7f & 0x7f), VA(RTC_BASE + RTCCNT)); 

	return ret;
}


// fixme
DRIVER_INIT(S3cRtcInit);
// SUBSYS_INIT(S3cRtcInit);


